//
//  ZBMutableArray.m
//  YouHui
//
//  Created by  on 11-11-28.
//  Copyright (c) 2011年 netease. All rights reserved.
//

#import "ZBMutableArray.h"

@implementation NSMutableArray(ZBExtention)

-(NSUInteger)indexOfString:(NSString*)key {
    NSUInteger index = 0;
    for (id element in self) {
        if ([element respondsToSelector:@selector(isEqualToString:)]) {
            if ([key isEqualToString:element]) {
                return index;
            }
        }
        index++;
    }
    return NSNotFound;
}

-(void)removeString:(NSString*)string {
    NSUInteger index =[self indexOfString:string];
    if (index!=NSNotFound) {
        [self removeObjectAtIndex:index];
    }
}

-(void)addString:(NSString*)string {
    NSUInteger index =[self indexOfString:string];
    if (index==NSNotFound) {
        [self addObject:string];
    }
}
@end
